import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { FormComponent } from './form/form.component';
import { ListComponent } from './list/list.component';
import { TreeTableComponent } from './tree-table/tree-table.component';

const routes: Routes = [
  {
    path: '',
    redirectTo: 'list',
    pathMatch: 'full',
  },
  {
    path: 'list',
    component: ListComponent,
    data: {
      title: '列表',
    },
  },
  {
    path: 'form',
    component: FormComponent,
    data: {
      title: '表单',
    },
  },
  {
    path: 'tree-table',
    component: TreeTableComponent,
    data: {
      title: '树形表',
    },
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class TemplateRoutingModule {}
